package com.bosssoft.ecds.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.bosssoft.ecds.entity.po.FbeStockFinanceapplyCheckPO;
import com.bosssoft.ecds.entity.po.FbeStockFinanceapplyItemPO;
import org.apache.ibatis.annotations.Select;

import java.math.BigInteger;
import java.util.List;

public interface FbeStockFinanceapplyCheckMapper extends BaseMapper<FbeStockFinanceapplyCheckPO> {

    /**
     * 查询指定ID的申领信息记录所对应的申请具体票据信息
     * @param id 申领信息记录Id
     * @return
     */
    @Select("SELECT " +
            "fai.* " +
            "FROM " +
            "fbe_stock_financeapply_item AS fai " +
            "INNER JOIN fbe_stock_financeapply_check AS fa " +
            "ON fa.f_id = fai.f_pid " +
            "WHERE " +
            "fa.f_id = #{id}")
    List<FbeStockFinanceapplyItemPO> getItems(BigInteger id);
}
